import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import index from './components/zbq/index'
import login from './components/zbq/login'
import home from './components/zbq/home'
import ht from './components/zbq/ht'
import pic from './components/zbq/pic'
import shoop from './components/zbq/shoop'
import classify from './components/zbq/classify'
import indent from './components/zbq/indent'
import bill from './components/zbq/bill'
import vip from './components/zbq/vip'
import grade from './components/zbq/grade'
import basics from './components/zbq/basics'
import bread from './components/zbq/bread'
// 移动端路由
import ydd_index from './components/ydd/ydd_index'
import tab from './components/ydd/tab'
import me from './components/ydd/me'
import yddlogin from './components/ydd/yddlogin'
import cutlist from './components/ydd/cutlist'
import yddclassify from './components/ydd/yddclassify'
import search from './components/ydd/search'
Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import( /* webpackChunkName: "about" */ './views/About.vue')
    },
    {
      path: '/index',
      component: index
    },
    {
      path: '/login',
      component: login
    },
    {
      path: '/bread',
      component: bread
    },
    {
      path: '/home',
      component: home,
      children: [{
          path: '/ht',
          component: ht,
          meta: {
            bread: ['后台首页']
          }


        },
        {
          path: '/pic',
          component: pic,
          meta: {
            bread: ['相册管理']
          }
        },
        {
          path: '/shoop',
          component: shoop,
          meta: {
            bread: ['商品列表']
          }
        },
        {
          path: '/classify',
          component: classify,
          meta:{
            bread:['分类列表']
          }
        },
        {
          path: '/indent',
          component: indent,
          meta:{
            bread:['订单管理']
          }
          
        },
        {
          path: '/bill',
          component: bill,
          meta:{
            bread:['订单发票']
          }
        },
        {
          path: '/vip',
          component: vip,
          meta:{
            bread:['会员列表']
          }
        },
        {
          path: '/grade',
          component: grade,
          meta:{
            bread:['会员等级']
          }
        },
        {
          path: '/basics',
          component: basics,
          meta:{
            bread:['基础设置']
          }
        }
      ]
    },

    // 移动端路由
    {
      path:'/yddlogin',
      component:yddlogin
    },
    {
      path:'/cutlist',
      component:cutlist
    },
    {
      path:'/tab',
      component:tab,
      children:[
        {
          path:'/ydd_index',
          component:ydd_index
        },
        {
          path:'/me',
          component:me
        },
        {
          path:'/yddclassify',
          component:yddclassify
        },{
          path:'/search',
          component:search
        }
      ]
    },
    
  ]
})